import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity } from 'typeorm';
import { BaseEntity } from '../../../base.entity';

@Entity({ name: 'gather_distribute_parameter' })
export default class GatherDistributeParameter extends BaseEntity {
  @Column({ type: 'varchar', length: 50, name: 'machine_code', comment: '设备编码' })
  @ApiProperty()
  machineCode: string;

  @Column({ type: 'varchar', length: 50, name: 'parameter_code', comment: '采集编码' })
  @ApiProperty()
  parameterCode: string;

  @Column({ type: 'varchar', length: 50, name: 'save_parameter_code', nullable: true })
  @ApiProperty()
  saveParameterCode: string;

  @Column({ type: 'varchar', length: 50, name: 'save_parameter_name', nullable: true })
  @ApiProperty()
  saveParameterName: string;

  @Column({ type: 'varchar', length: 50, name: 'parameter_name', comment: '采集名称' })
  @ApiProperty()
  parameterName: string;

  @Column({ type: 'varchar', length: 50, name: 'type', comment: '下发值类型' })
  @ApiProperty()
  type: string;

  @Column({ type: 'float', name: 'value', nullable: true, comment: '固定值' })
  @ApiProperty()
  value: number;

  @Column({ type: 'varchar', length: 50, name: 'dict_type_code', nullable: true, comment: '字典编码' })
  @ApiProperty()
  dictTypeCode: string;

  @Column({ type: 'varchar', length: 50, name: 'dictionary_key', nullable: true, comment: '字典表字段' })
  @ApiProperty()
  dictionaryKey: string;

  @Column({ type: 'varchar', length: 50, name: 'material_key', nullable: true, comment: '产品字段' })
  @ApiProperty()
  materialKey: string;

  @Column({ type: 'varchar', length: 50, name: 'order_key', nullable: true, comment: '工单字段' })
  @ApiProperty()
  orderKey: string;

  @Column({ type: 'float', name: 'decimal_places', nullable: true, comment: '小数位' })
  @ApiProperty()
  decimalPlaces: number;

  @Column({ type: 'float', name: 'is_save_by_material', nullable: true, comment: '是否保存参数' })
  @ApiProperty()
  isSaveByMaterial: number;

  @Column({ type: 'float', name: 'distribute_type', nullable: true, comment: '下发方式' })
  @ApiProperty()
  distributeType: number;

  @Column({ type: 'float', name: 'delay_time', nullable: true, comment: '延迟时间（ms）' })
  @ApiProperty()
  delayTime: number;

  @Column({ type: 'float', name: 'is_distribute_by_auto_change_order', nullable: true, comment: '自动换单是否下发参数' })
  @ApiProperty()
  isDistributeByAutoChangeOrder: number;

  @Column({ type: 'float', name: 'pro_order', nullable: true, comment: '开工顺序' })
  @ApiProperty()
  proOrder: number;

  @Column({ type: 'varchar', nullable: true, comment: '备注' })
  @ApiProperty()
  remark: string;
}
